home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / enh-spell < prev    next >
Encoding:
Text File  |  1990-02-20  |  7.3 KB  |  265 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Megatest Corporation, San Jose, Ca
  3. keywords: spell spellin spellout hlista stopa
  4. subject: v10i080: enhancements to Unix spell
  5. From: djones@uunet.uu.net@megatest.UUCP (Dave Jones)
  6. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  7.  
  8. Posting-number: Volume 10, Issue 80
  9. Submitted-by: djones@uunet.uu.net@megatest.UUCP (Dave Jones)
  10. Archive-name: enh-spell
  11.  
  12. Unix comes with a 'spell' utility complete with a file of
  13. correctly spelled words, and a file of derived words which
  14. look plausible to the 'spell' program, but are not. But
  15. the lists are not as complete as one would like.
  16.  
  17. Here are some routines for augmenting the released spelling lists,
  18. and using them with the spell-routine.
  19.  
  20. Commands:
  21.  
  22.    learn_word   ... Learn correct spelling of a word or words.
  23.    bad_word     ... Learn that a word which might be derived from
  24.                     spell's spelling rules is in fact misspelled.
  25.    spell        ... Like spell, but uses the augmented lists.
  26.  
  27.  
  28. I've also included 'words' and 'stop' files of words which have come
  29. up in my writing over the past few months. There's only one word in the
  30. stop-list: 'primative', which I suppose it derives as 'prima' + 'tive'.
  31. The correct spelling is 'primitive', which is in the standard list.
  32.  
  33. The 'words' list has seventy-eight so far, some of which may not be suitable
  34. to all occasions.
  35.  
  36.  
  37. #! /bin/sh
  38. # This is a shell archive.  Remove anything before this line, then unpack
  39. # it by saving it into a file and typing "sh file".  To overwrite existing
  40. # files, type "sh file -c".  You can also feed this as standard input via
  41. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  42. # will see the following message at the end:
  43. #        "End of shell archive."
  44. # Contents:  README bad_word learn_word spell stop words
  45. # Wrapped by djones@goofy on Thu Feb 15 20:56:09 1990
  46. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  47. if test -f README -a "${1}" != "-c" ; then 
  48.   echo shar: Will not over-write existing file \"README\"
  49. else
  50. echo shar: Extracting \"README\" \(977 characters\)
  51. sed "s/^X//" >README <<'END_OF_README'
  52. XUnix comes with a 'spell' utility complete with a file of
  53. Xcorrectly spelled words, and a file of derived words which
  54. Xlook plausible to the 'spell' program, but are not. But
  55. Xthe lists are not as complete as one would like.
  56. X
  57. XHere are some routines for augmenting the released spelling lists,
  58. Xand using them with the spell-routine.
  59. X
  60. XCommands:
  61. X
  62. X   learn_word   ... Learn correct spelling of a word or words.
  63. X   bad_word     ... Learn that a word which might be derived from
  64. X                    spell's spelling rules is in fact misspelled.
  65. X   spell        ... Like spell, but uses the augmented lists.
  66. X
  67. X
  68. XI've also included 'words' and 'stop' files of words which have come
  69. Xup in my writing over the past few months. There's only one word in the
  70. Xstop-list: 'primative', which I suppose it derives as 'prima' + 'tive'.
  71. XThe correct spelling is 'primitive', which is in the standard list.
  72. X
  73. XThe 'words' list has seventy-eight so far, some of which may not be suitable
  74. Xto all occasions.
  75. END_OF_README
  76. if test 977 -ne `wc -c <README`; then
  77.     echo shar: \"README\" unpacked with wrong size!
  78. fi
  79. # end of overwriting check
  80. fi
  81. if test -f bad_word -a "${1}" != "-c" ; then 
  82.   echo shar: Will not over-write existing file \"bad_word\"
  83. else
  84. echo shar: Extracting \"bad_word\" \(791 characters\)
  85. sed "s/^X//" >bad_word <<'END_OF_bad_word'
  86. X#! /bin/csh -f
  87. X# Learn an incorrect spelling of a word or words. (Spellings which
  88. X# might be generated from general spelling rules. See man-page for 'spell'.)
  89. X#
  90. X# Creates and maintains files
  91. X#    ~/lib/stop    ... sorted text of words to suppliment standard stop-list
  92. X#    ~/lib/hstop   ... supplimental and standard lists, merged and hashed
  93. X#    ~/lib/stop.temp  ... scratch file
  94. X#    ~/lib/hstop.temp ... scratch file
  95. X# 
  96. X# I don't know why I need to make a copy of /usr/dict/hstop, but
  97. X# that's the only way I found to make it work. .. djones
  98. X
  99. X# See also learn_word
  100. X
  101. Xecho $* | tr ' ' '\012' >> ~/lib/stop
  102. Xsort -u ~/lib/stop > ~/lib/stop.temp
  103. Xmv ~/lib/stop.temp ~/lib/stop
  104. Xcp /usr/dict/hstop ~/lib/hstop.temp
  105. X/usr/bin/spellin ~/lib/hstop.temp < ~/lib/stop > ~/lib/hstop
  106. Xrm ~/lib/hstop.temp
  107. END_OF_bad_word
  108. if test 791 -ne `wc -c <bad_word`; then
  109.     echo shar: \"bad_word\" unpacked with wrong size!
  110. fi
  111. chmod +x bad_word
  112. # end of overwriting check
  113. fi
  114. if test -f learn_word -a "${1}" != "-c" ; then 
  115.   echo shar: Will not over-write existing file \"learn_word\"
  116. else
  117. echo shar: Extracting \"learn_word\" \(701 characters\)
  118. sed "s/^X//" >learn_word <<'END_OF_learn_word'
  119. X#! /bin/csh -f
  120. X# Learn the correct spelling of a word or words.
  121. X# Creates and maintains files
  122. X#    ~/lib/words   ... sorted text of words to suppliment standard list
  123. X#    ~/lib/hlista  ... supplimental and standard lists, merged and hashed
  124. X#    ~/lib/words.temp  ... scratch file
  125. X#    ~/lib/hlista.temp ... scratch file
  126. X# 
  127. X# I don't know why I need to make a copy of /usr/dict/hlista, but
  128. X# that's the only way I found to make it work. .. djones
  129. X
  130. X# See also bad_word
  131. X
  132. Xecho $* | tr ' ' '\012' >> ~/lib/words
  133. Xsort -u ~/lib/words > ~/lib/words.temp
  134. Xmv ~/lib/words.temp ~/lib/words
  135. Xcp /usr/dict/hlista ~/lib/hlista.temp
  136. X/usr/bin/spellin ~/lib/hlista.temp < ~/lib/words > ~/lib/hlista
  137. Xrm ~/lib/hlista.temp
  138. END_OF_learn_word
  139. if test 701 -ne `wc -c <learn_word`; then
  140.     echo shar: \"learn_word\" unpacked with wrong size!
  141. fi
  142. chmod +x learn_word
  143. # end of overwriting check
  144. fi
  145. if test -f spell -a "${1}" != "-c" ; then 
  146.   echo shar: Will not over-write existing file \"spell\"
  147. else
  148. echo shar: Extracting \"spell\" \(65 characters\)
  149. sed "s/^X//" >spell <<'END_OF_spell'
  150. X#! /bin/csh -f
  151. X
  152. X/usr/bin/spell -d ~/lib/hlista -s ~/lib/hstop $*
  153. END_OF_spell
  154. if test 65 -ne `wc -c <spell`; then
  155.     echo shar: \"spell\" unpacked with wrong size!
  156. fi
  157. chmod +x spell
  158. # end of overwriting check
  159. fi
  160. if test -f stop -a "${1}" != "-c" ; then 
  161.   echo shar: Will not over-write existing file \"stop\"
  162. else
  163. echo shar: Extracting \"stop\" \(10 characters\)
  164. sed "s/^X//" >stop <<'END_OF_stop'
  165. Xprimative
  166. END_OF_stop
  167. if test 10 -ne `wc -c <stop`; then
  168.     echo shar: \"stop\" unpacked with wrong size!
  169. fi
  170. # end of overwriting check
  171. fi
  172. if test -f words -a "${1}" != "-c" ; then 
  173.   echo shar: Will not over-write existing file \"words\"
  174. else
  175. echo shar: Extracting \"words\" \(722 characters\)
  176. sed "s/^X//" >words <<'END_OF_words'
  177. XEuropean
  178. XMegatest
  179. XMidwestern
  180. Xabsurdum
  181. Xaccusatory
  182. Xafoul
  183. Xastrology
  184. Xaustralopithecine
  185. Xawestricken
  186. Xawestruck
  187. Xbaloney
  188. Xchimp
  189. Xclamor
  190. Xcombo
  191. Xdecimate
  192. Xdefamation
  193. Xdetritus
  194. Xdiminuendo
  195. Xdoggerel
  196. Xdoily
  197. Xemblem
  198. Xemote
  199. Xendorphin
  200. Xerstwhile
  201. Xeuphony
  202. Xgonorrhea
  203. Xgoodbye
  204. Xheadstrong
  205. Xhomey
  206. Xhominem
  207. Xhominid
  208. Xhomophone
  209. Xhorrific
  210. Ximpanel
  211. Xinnocuous
  212. Xinstantiate
  213. Xjackal
  214. Xkeystroke
  215. Xmillion
  216. Xmitochondria
  217. Xmitochondrial
  218. Xmitochondrion
  219. Xnauseous
  220. Xnecrophilia
  221. Xobtuse
  222. Xpabulum
  223. Xpeccadillo
  224. Xpentatonic
  225. Xperitoneal
  226. Xphlegm
  227. Xpiney
  228. Xpiscine
  229. Xpittance
  230. Xpolymorhism
  231. Xpontificate
  232. Xpontification
  233. Xpontificator
  234. Xpostdict
  235. Xprevaricate
  236. Xpreventative
  237. Xprofundo
  238. Xprogram
  239. Xprolog
  240. Xreductio
  241. Xsatchel
  242. Xsavanna
  243. Xsavannah
  244. Xshit
  245. Xsmelly
  246. Xstrident
  247. Xtimorous
  248. Xtinnitus
  249. Xtrichotomy
  250. Xvapid
  251. Xyankee
  252. Xyoghurt
  253. Xyogurt
  254. Xzetetic
  255. END_OF_words
  256. if test 722 -ne `wc -c <words`; then
  257.     echo shar: \"words\" unpacked with wrong size!
  258. fi
  259. # end of overwriting check
  260. fi
  261. echo shar: End of shell archive.
  262. exit 0
  263.  
  264.  
  265.